package com.atguigu.gmallre.mock;


import com.atguigu.gmallre.mock.task.TestMockTask;
import com.atguigu.gmallre.mock.task.UserMockTask;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;


@MapperScan(basePackages = "com.atguigu.gmallre.mock.mapper")
@SpringBootApplication
public class GmallRemakeMockApplication {

    public static void main(String[] args) {
            if(args!=null&&args.length>0){
                String mode = args[0];
                if(mode.equals("test")){
                    TestMockTask mockTask=new TestMockTask();
                    mockTask.mock();
                }
                return;
            }


            ConfigurableApplicationContext context = SpringApplication.run(GmallRemakeMockApplication.class, args);

           UserMockTask mockTask = context.getBean(UserMockTask.class);
            mockTask.mainTask();

//动态
    }
}
